import Vue from "vue";
import Router from "vue-router";
import Login from "@/components/Login";
import AdminIndex from "@/components/admin/index";
// 用户
import AdminRegUserList from "@/components/admin/user/regUserList";
// 订单
import WaitCarpoolList from "@/components/admin/order/waitCarpoolList";
import WaitMatchList from "@/components/admin/order/waitMatchList";
import AllOrderList from "@/components/admin/order/allList";
// 系统管理
import AdminList from "@/components/admin/sysmgr/adminlist";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      name: "登录",
      component: Login
    },
    {
      path: "/login",
      name: "登录",
      component: Login
    },
    {
      path: "/admin",
      name: "首页",
      component: AdminIndex,
      children: [
        {
          path: "/admin/index",
          name: "首页",
          component: AdminIndex
        },
        // 用户管理
        {
          path: "/admin/user/list",
          name: "用户列表",
          component: AdminRegUserList
        },
        // 订单管理
        {
          path: "/admin/order/waitCarpoolList",
          name: "待拼车订单",
          component: WaitCarpoolList
        },
        {
          path: "/admin/order/waitMatchList",
          name: "待匹配订单",
          component: WaitMatchList
        },
        {
          path: "/admin/order/allList",
          name: "全部订单",
          component: AllOrderList
        },
        {
          path: "/admin/sysmgr/adminlist",
          name: "管理员列表",
          component: AdminList
        }
      ]
    }
  ]
});
